package com.csgc.camera.biz.other.activity

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager

import com.csgc.camera.base.BaseBindingActivity
import com.csgc.camera.biz.other.adapter.MaskDateStyleAdapter

import com.csgc.camera.events.MaskDataStyleEvent
import com.csgc.camera.util.clickWithTrigger
import com.cysd.spsyxj.R
import com.cysd.spsyxj.databinding.ActivityMaskDateStyleBinding

import com.drake.channel.receiveEvent
import com.gyf.immersionbar.ktx.immersionBar
import com.hlyj.http.ad.NewGroMoreFeedAdManager
import com.hnyyac.ad.mds.IAdView
import com.hnyyac.ad.mds.IAdViewListener
import com.hnyyac.ad.mds.manager.AdManager
import com.hnyyac.ad.mds.manager.AdManager.AdLoadListener
import com.hnyyac.ad.mds.utils.BaseAdConstants

class MaskDateStyleActivity:BaseBindingActivity<ActivityMaskDateStyleBinding>(ActivityMaskDateStyleBinding::inflate),IAdViewListener {

    companion object{
        fun launch(context: Context){
            context.startActivity(Intent(context,MaskDateStyleActivity::class.java))
        }
    }
    private val adapter:MaskDateStyleAdapter by lazy {
        MaskDateStyleAdapter(this)
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        immersionBar {
            //界面在状态栏底部true   界面在状态栏下面沉浸式盖着界面false
            fitsSystemWindows(true)
            //白色状态栏，黑色字体
            statusBarColor(R.color.white)
            statusBarDarkFont(true)
        }

        binding.rvDateStyle.layoutManager = LinearLayoutManager(this,LinearLayoutManager.VERTICAL,false)
        binding.rvDateStyle.adapter = adapter

        binding.ivBack.clickWithTrigger { finish() }

        //广告插入
        val newGromoreFeedAd: NewGroMoreFeedAdManager = NewGroMoreFeedAdManager(this, BaseAdConstants.FEEDAD_Id, binding?.frameContent, 66)
        newGromoreFeedAd.loadAd()
        showDoubleChaPin()
    }
    //统一双插屏无需加位置
    fun showDoubleChaPin(){
        AdManager.loadChapin_nocache(
            this,
            666,
            this,
            object : AdLoadListener {
                override fun onAdLoadFailed(ad: IAdView?) {

                }
            })
    }

    override fun onTrigger(adView: IAdView) {

    }

    override fun onAdShow(adView: IAdView) {

    }

    override fun onAdClick(adView: IAdView) {

    }

    override fun onAdClose(adView: IAdView) {

    }

    override fun onError(msg: String) {

    }

    override fun onLoadError(adView: IAdView) {

    }

    override fun onSuccess(adView: IAdView) {

    }

    override fun onLoad(adView: IAdView) {

    }

    override fun onSkipped() {

    }

    override fun onNoAd() {

    }

    override fun onTimeOut() {

    }
}